<template>
    <div class="child">
        <h3>子组件二</h3>
        <h4>电脑: {{ computer }}</h4>
        <h4>书籍： {{ book }}本</h4>
    </div>
</template>

<script setup lang="ts" name="Child">
import {ref} from 'vue'

// 数据
let computer = ref('联想')
let book = ref(6)
// 把数据交给外部
defineExpose({computer,book})
</script>

<style scoped>
    .child{
        background-color: skyblue;
        padding: 10px;
        box-shadow: 0 0 10px black;
        border-radius: 10px;
    }
</style>